#include <bits/stdc++.h>
#include <string>
using namespace std;


int main()
{
    string str;
	cin >> str;
	int leftOneNums = 0,times=0;
	for(int i=0;i<str.length();i++){
       if(str.at(i)=='0') times+=leftOneNums;
	   else leftOneNums++;
	}
	cout << times;
	return 0;
}
